﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

/**
 * Basic security class which checks a condition and then display an error message in case it is not true
 *  
 * @version 1.0
 * @authors:
 *      Fabien DUCHENE f.duchene@car-online.fr
 */
namespace ChgPwd
{
    public class Security
    {
        public static void Check(Boolean condition, String error_message, System.Web.UI.Page PageWeb)
        {
            if (!condition)
            {

                // display an error message in the UserMessage control
                ((Label)PageWeb.FindControl("UserMessage")).Text = error_message;
            }
        }
    }
}